home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form NewMessage
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "New Message"
- ClientHeight = 8340
- ClientLeft = 1905
- ClientTop = 1980
- ClientWidth = 7410
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 8745
- Left = 1845
- LinkTopic = "Form1"
- ScaleHeight = 8340
- ScaleWidth = 7410
- Top = 1635
- Width = 7530
- Begin VB.Frame Frame1
- Caption = "Attachment Encoding"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 1320
- TabIndex = 13
- Top = 1920
- Width = 3135
- Begin VB.OptionButton optUU
- Caption = "UU"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 1440
- TabIndex = 17
- Top = 480
- Width = 1215
- End
- Begin VB.OptionButton optQuotedPrintable
- Caption = "Quoted-Printable"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 1440
- TabIndex = 16
- Top = 240
- Width = 1575
- End
- Begin VB.OptionButton optBinhex40
- Caption = "Binhex40"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 480
- Width = 1215
- End
- Begin VB.OptionButton optBase64
- Caption = "Base64"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 240
- Value = -1 'True
- Width = 1215
- End
- End
- Begin VB.ComboBox cmbAttachments
- Appearance = 0 'Flat
- Height = 315
- Left = 1320
- Style = 2 'Dropdown List
- TabIndex = 12
- Top = 1560
- Width = 5415
- End
- Begin VB.CommandButton Command1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "&Attachments:"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 315
- Left = 0
- TabIndex = 5
- Top = 1560
- Width = 1215
- End
- Begin VB.TextBox txtBCC
- Appearance = 0 'Flat
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 1320
- TabIndex = 4
- Top = 1200
- Width = 5895
- End
- Begin VB.TextBox txtCC
- Appearance = 0 'Flat
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 1320
- TabIndex = 3
- Top = 840
- Width = 5895
- End
- Begin VB.TextBox txtBody
- Appearance = 0 'Flat
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Courier New"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 4875
- Left = 90
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 6
- Top = 3360
- Width = 7140
- End
- Begin VB.CommandButton Cancel
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Cancel = -1 'True
- Caption = "Cancel"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 120
- TabIndex = 8
- Top = 2280
- Width = 870
- End
- Begin VB.CommandButton Send
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Send"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 120
- TabIndex = 7
- Top = 1920
- Width = 870
- End
- Begin VB.TextBox txtSubject
- Appearance = 0 'Flat
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 1320
- TabIndex = 2
- Top = 480
- Width = 5895
- End
- Begin VB.TextBox txtTo
- Appearance = 0 'Flat
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 330
- Left = 1320
- TabIndex = 1
- Top = 120
- Width = 5895
- End
- Begin MailLib.mMail Mail1
- Left = 6600
- Top = 2280
- _Version = 327680
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- Blocking = 0 'False
- Debug = 1
- Host = ""
- Timeout = 0
- ConnectType = 0
- PopPort = 110
- SmtpPort = 25
- End
- Begin MSComDlg.CommonDialog cmdialog1
- Left = 6120
- Top = 2280
- _ExtentX = 847
- _ExtentY = 847
- _Version = 327680
- FontSize = 3.48643e-38
- End
- Begin VB.Label Label4
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&BCC:"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 270
- Left = 120
- TabIndex = 11
- Top = 1200
- Width = 1065
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&CC:"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 270
- Left = 120
- TabIndex = 10
- Top = 840
- Width = 1065
- End
- Begin VB.Line Line2
- BorderColor = &H00FFFFFF&
- X1 = 0
- X2 = 7260
- Y1 = 2880
- Y2 = 2880
- End
- Begin VB.Line Line1
- BorderColor = &H00808080&
- X1 = 120
- X2 = 7425
- Y1 = 2880
- Y2 = 2880
- End
- Begin VB.Label Label2
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&Subject:"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 270
- Left = 105
- TabIndex = 9
- Top = 450
- Width = 1065
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&To:"
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 270
- Left = 90
- TabIndex = 0
- Top = 120
- Width = 1065
- End
- Attribute VB_Name = "NewMessage"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- ' For spacing during Form_Resize
- Const Margin = 2
- Dim State As Integer
- Const StateSending = 1
- Const StateConnecting = 2
- Const StateDisconnecting = 3
- Private Sub Cancel_Click()
- Unload Me
- End Sub
- Private Sub Command1_Click()
- Dim boundary As Double
- Dim fEncode As Integer
- On Error Resume Next
- cmdialog1.Action = 1
- If (Err <> 0) Then
- MsgBox Error
- End If
- On Error GoTo 0
- cmbAttachments.AddItem cmdialog1.filename
- cmbAttachments.ListIndex = cmbAttachments.ListCount - 1
- If (Mail1.ContentType <> "multipart") Then
- boundary = Fix(Rnd * 100000000000#)
- Mail1.ContentType = "multipart"
- Mail1.ContentSubtype = "mixed"
- Mail1.ContentSubtypeParameters = "boundary=" & CStr(boundary) & "_boundary"
- Mail1.MultipartBoundary = CStr(boundary) & "_boundary"
- End If
- Mail1.Action = MailActionCreatePart
- Mail1.Action = MailActionDescend
- fEncode = False
- If (optBinhex40.Value) Then
- Mail1.ContentTransferEncoding = "mac-binhex40"
- ElseIf (optUU.Value) Then
- Mail1.ContentTransferEncoding = "x-uuencode"
- ElseIf (optQuotedPrintable.Value) Then
- Mail1.ContentTransferEncoding = "quoted-printable"
- Else
- Mail1.ContentTransferEncoding = "base64"
- End If
- Select Case LCase(Mid(cmdialog1.FileTitle, InStr(cmdialog1.FileTitle, ".")))
- Case ".zip"
- Mail1.ContentType = "application"
- Mail1.ContentSubtype = "x-zip-compressed"
- Mail1.ContentSubtypeParameters = "name=" & Chr(34) & cmdialog1.filename & Chr(34)
- Mail1.ContentDisposition = "attachment; filename=" & Chr(34) & cmdialog1.FileTitle & Chr(34)
- fEncode = True
- Case ".txt"
- Dim S As String
-
- Mail1.ContentType = "text"
- Mail1.ContentSubtype = "plain"
- Mail1.ContentSubtypeParameters = "charset=us-ascii"
- Mail1.ContentTransferEncoding = "7bit"
- Mail1.ContentDisposition = "inline; filename=" & Chr(34) & cmdialog1.filename & Chr(34)
- '
- ' note this only works for files < 32k
- '
- Open cmdialog1.filename For Binary As #1
- S = String(LOF(1), 0)
- Get #1, , S
- Mail1.Body(0) = S
- Close #1
- Case ".gif", ".bmp", ".jpg"
- Mail1.ContentType = "image"
- Mail1.ContentSubtype = LCase(Mid(cmdialog1.FileTitle, InStr(cmdialog1.FileTitle, ".") + 1))
- Mail1.ContentDisposition = "inline; filename=" & Chr(34) & cmdialog1.FileTitle & Chr(34)
- fEncode = True
- Case Else
- Mail1.ContentType = "application"
- Mail1.ContentSubtype = "octet-stream"
- Mail1.ContentDisposition = "attachment; filename=" & Chr(34) & cmdialog1.FileTitle & Chr(34)
- fEncode = True
- End Select
- If (fEncode) Then
- Mail1.Flags = MailSrcIsFile Or MailDstIsBody
- Mail1.SrcFilename = cmdialog1.filename
- Mail1.Action = MailActionEncode
- End If
- Mail1.Action = MailActionAscend
- End Sub
- Private Sub Form_Load()
- Mail1.From = g_emailaddr
- Mail1.To = txtTo.Text
- End Sub
- Private Sub Form_Resize()
- If Me.WindowState = 1 Then
- Exit Sub
- End If
-
- Line1.X1 = 0
- Line1.X1 = 0
- Line2.X2 = Me.ScaleWidth
- Line2.X2 = Me.ScaleWidth
- txtTo.Width = Me.ScaleWidth - txtTo.Left - Margin * 2
- txtSubject.Width = txtTo.Width
- txtCC.Width = txtTo.Width
- txtBCC.Width = txtTo.Width
- cmbAttachments.Width = txtTo.Width
- txtBody.Left = Margin
- txtBody.Width = Me.ScaleWidth - 2 * Margin
- txtBody.Top = Line1.Y2 + Margin * 5
- txtBody.Height = Me.ScaleHeight - txtBody.Top - Margin * 5
- End Sub
- Private Sub Mail1_AsyncError(ByVal ErrorCode As Integer, ByVal ErrorMessage As String)
- MsgBox ErrorMessage
- State = StateDisconnecting
- Mail1.Action = MailActionDisconnect
- End Sub
- Private Sub MAIL1_Debug(ByVal message As String)
- Debug.Print message
- End Sub
- Private Sub Mail1_Done()
- Screen.MousePointer = 0
- Select Case State
- Case StateConnecting
- State = StateSending
- Mail1.Flags = MailDstIsHost
- Mail1.Action = MailActionWriteMessage
- If (Mail1.Blocking = True) Then
- Mail1_Done
- End If
- Case StateSending
- State = StateDisconnecting
- Mail1.Action = MailActionDisconnect
- If (Mail1.Blocking = True) Then
- Mail1_Done
- End If
- Case StateDisconnecting
- Unload Me
- End Select
- End Sub
- Private Sub Send_Click()
- Mail1.To = txtTo.Text
- Mail1.Subject = txtSubject.Text
- Mail1.From = g_username & " <" & g_emailaddr & ">"
- Mail1.CC = txtCC.Text
- Mail1.BCC = txtBCC.Text
- Mail1.Headers(Mail1.HeadersCount) = "X-Mailer: Mabry"
- Mail1.Host = g_SmtpHost
- Mail1.EMailAddress = Chr(34) & g_username & Chr(34) & "<" & g_emailaddr & ">"
- Mail1.MessageID = Year(Now) & Month(Now) & Day(Now) & Fix(Timer) & "_MabryMail"
- If (Mail1.Parts > 0 And txtBody.Text <> "") Then
- Mail1.Part = 0
- Mail1.Action = MailActionCreatePart
- Mail1.Action = MailActionDescend
- Mail1.Body(0) = txtBody.Text
- Mail1.Action = MailActionAscend
- Else
- Mail1.Body(0) = txtBody.Text
- End If
- Screen.MousePointer = 11
- State = StateConnecting
- Mail1.Action = MailActionConnect
- If (Mail1.Blocking = True) Then
- Mail1_Done
- End If
- End Sub
-